/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.sdd.facades.factories;

import com.sdd.entities.FeatureCategory;
import com.sdd.plains.FeatureCategoryPlain;
import java.util.ArrayList;
import java.util.List;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;

/**
 *
 * @author T
 */
@Stateless
@LocalBean
public class FeatureCategoryFactoryFacadeBean {
    
   
    public FeatureCategoryPlain createFeatureCategoryPlain(FeatureCategory entity) {
        if (entity==null)
            return null;
        FeatureCategoryPlain ret = new FeatureCategoryPlain();
        ret.setId(entity.getId());
        ret.setName(entity.getName());
        ret.setDescription(entity.getDescription());
        return ret;
    }
    
    public FeatureCategory createFeatureCategory(FeatureCategoryPlain fcp){
        if (fcp==null)
            return null;
        FeatureCategory ret = new FeatureCategory();
        ret.setId(fcp.getId());
        ret.setName(fcp.getName());
        ret.setDescription(fcp.getDescription());
        return ret;
    }

        
    public List<FeatureCategoryPlain> createFeatureCategoriesPlains(List<FeatureCategory> entities){
        if (entities==null)
            return null;
        List<FeatureCategoryPlain> ret = new ArrayList<FeatureCategoryPlain>();
        for (FeatureCategory featureCategory : entities) {
            ret.add(createFeatureCategoryPlain(featureCategory));
        }
        return ret;
    }
    
    
}
